﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2><%= Html.Encode(ViewData["Message"]) %></h2>
    
      <% Html.Grid<Model.Company>(ViewData["Company"] as IEnumerable<Model.Company>,
        columns =>
        {
            columns.For("公司编号").Do(x => 
            {
                %><td><a href="<%="/Home/GetCompany/" + x.CompanyID.ToString() %>">
                <%= x.CompanyID.ToString()%>
                </a></td><%
            });
            columns.For(x => x.CompanyName, "公司名称");
        }  
    );%>
    
    <form action="/Home/SaveCompany" method="post">
        <table>
            <tr>
                <td>公司名称</td><td><input type="text" name="company.CompanyName" /></td>
            </tr>  
            <tr  align="center">
                <td colspan="2"><input type="submit" value="增加" /></td>
            </tr>
        </table>
    </form>
    
    <p>
        To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
    </p>
</asp:Content>
